// @ts-ignore
import { api } from '@/utils/api';

/** 新增应用表数据 POST /sysApplication/add */
export async function sysApplicationAdd(
  body: BASE.SysApplication,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function sysApplicationAdd(
  body: BASE.SysApplication,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function sysApplicationAdd(
  body: BASE.SysApplication,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function sysApplicationAdd(
  body: BASE.SysApplication,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/sysApplication/add`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/sysApplication/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 应用授权给用户 POST /sysApplication/authorize */
export async function sysApplicationAuthorize(
  body: BASE.ApplicationAuthorizeDto,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultBoolean>;

export async function sysApplicationAuthorize(
  body: BASE.ApplicationAuthorizeDto,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultBoolean>>;

export async function sysApplicationAuthorize(
  body: BASE.ApplicationAuthorizeDto,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultBoolean>;

export async function sysApplicationAuthorize(
  body: BASE.ApplicationAuthorizeDto,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultBoolean>(`/app/sysApplication/authorize`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultBoolean>(`/app/sysApplication/authorize`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 应用授权接口 POST /sysApplication/authorizeApi */
export async function sysApplicationAuthorizeApi(
  body: BASE.ApplicationAuthorizeApiDto,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultBoolean>;

export async function sysApplicationAuthorizeApi(
  body: BASE.ApplicationAuthorizeApiDto,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultBoolean>>;

export async function sysApplicationAuthorizeApi(
  body: BASE.ApplicationAuthorizeApiDto,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultBoolean>;

export async function sysApplicationAuthorizeApi(
  body: BASE.ApplicationAuthorizeApiDto,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultBoolean>(`/app/sysApplication/authorizeApi`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultBoolean>(`/app/sysApplication/authorizeApi`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 删除应用表数据 POST /sysApplication/delete */
export async function sysApplicationDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function sysApplicationDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function sysApplicationDelete(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function sysApplicationDelete(body: BASE.ID, options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/sysApplication/delete`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/sysApplication/delete`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 获取应用AppId和AppSecret POST /sysApplication/getIdSecret */
export async function sysApplicationGetIdSecret(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultApplicationSecretInfo>;

export async function sysApplicationGetIdSecret(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultApplicationSecretInfo>>;

export async function sysApplicationGetIdSecret(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultApplicationSecretInfo>;

export async function sysApplicationGetIdSecret(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultApplicationSecretInfo>(`/app/sysApplication/getIdSecret`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultApplicationSecretInfo>(`/app/sysApplication/getIdSecret`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 获取应用表VO数据 POST /sysApplication/getVo */
export async function sysApplicationGetVo(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultSysApplicationVO>;

export async function sysApplicationGetVo(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultSysApplicationVO>>;

export async function sysApplicationGetVo(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultSysApplicationVO>;

export async function sysApplicationGetVo(body: BASE.ID, options?: ArgumentsType<typeof api>[1]) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultSysApplicationVO>(`/app/sysApplication/getVo`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultSysApplicationVO>(`/app/sysApplication/getVo`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 我的应用 POST /sysApplication/myApplication */
export async function sysApplicationMyApplication(
  body: BASE.MyApplicationQuery,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultListSysApplication>;

export async function sysApplicationMyApplication(
  body: BASE.MyApplicationQuery,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultListSysApplication>>;

export async function sysApplicationMyApplication(
  body: BASE.MyApplicationQuery,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultListSysApplication>;

export async function sysApplicationMyApplication(
  body: BASE.MyApplicationQuery,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultListSysApplication>(`/app/sysApplication/myApplication`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultListSysApplication>(`/app/sysApplication/myApplication`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 更新应用表数据 POST /sysApplication/update */
export async function sysApplicationUpdate(
  body: BASE.SysApplication,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function sysApplicationUpdate(
  body: BASE.SysApplication,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function sysApplicationUpdate(
  body: BASE.SysApplication,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function sysApplicationUpdate(
  body: BASE.SysApplication,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/sysApplication/update`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/sysApplication/update`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 更新应用秘钥 POST /sysApplication/updateSecret */
export async function sysApplicationUpdateSecret(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResult>;

export async function sysApplicationUpdateSecret(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResult>>;

export async function sysApplicationUpdateSecret(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResult>;

export async function sysApplicationUpdateSecret(
  body: BASE.ID,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResult>(`/app/sysApplication/updateSecret`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResult>(`/app/sysApplication/updateSecret`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}

/** 获取应用表VO分页数据 POST /sysApplication/voPage */
export async function sysApplicationVoPage(
  body: BASE.SysApplicationQuery,
  options?: ArgumentsType<typeof api>[1]
): Promise<BASE.IResultIPageSysApplicationVO>;

export async function sysApplicationVoPage(
  body: BASE.SysApplicationQuery,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: true }
): Promise<TupleResponse<BASE.IResultIPageSysApplicationVO>>;

export async function sysApplicationVoPage(
  body: BASE.SysApplicationQuery,
  options?: ArgumentsType<typeof api>[1] & { tupleResponse: false }
): Promise<BASE.IResultIPageSysApplicationVO>;

export async function sysApplicationVoPage(
  body: BASE.SysApplicationQuery,
  options?: ArgumentsType<typeof api>[1]
) {
  if (
    (
      options as ArgumentsType<typeof api>[1] & {
        tupleResponse: boolean;
      }
    )?.tupleResponse === true
  ) {
    return api<BASE.IResultIPageSysApplicationVO>(`/app/sysApplication/voPage`, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      data: body,
      ...(options || {}),
      tupleResponse: true
    });
  }

  return api<BASE.IResultIPageSysApplicationVO>(`/app/sysApplication/voPage`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  });
}
